Skip to content

[Relax] Fix divide-by-zero in HasReshapePattern for zero-extent blocks#19961

Closed
cchung100m wants to merge 2 commits into
apache:mainfrom
cchung100m:issue-19922
Closed

[Relax] Fix divide-by-zero in HasReshapePattern for zero-extent blocks#19961
cchung100m wants to merge 2 commits into
apache:mainfrom
cchung100m:issue-19922

Conversation

@cchung100m

Copy link
Copy Markdown
Contributor

Hi Committers,

This PR addresses issue #19922 and #17745. Any suggestions would be appreciated if you are available.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@cchung100m

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a check in HasReshapePattern to handle zero-extent loops and prevent potential crashes, along with corresponding unit tests. The reviewer suggests using ana_->CanProveEqual(v->dom->extent, 0) instead of is_zero(v->dom->extent) to robustly handle symbolic expressions that simplify to zero.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/relax/analysis/tir_op_pattern_kind.cc Outdated
@cchung100m cchung100m marked this pull request as ready for review July 8, 2026 00:15
@cchung100m

Copy link
Copy Markdown
Contributor Author

This PR duplicates the work in #19958, which is tracking issues #19922 and #17745. Therefore, I'm closing this PR.

@cchung100m cchung100m closed this Jul 8, 2026
@cchung100m cchung100m deleted the issue-19922 branch July 8, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant